package com.sfzd5.UI;

import net.atlanticbb.tantlinger.shef.HTMLEditorPane;

import javax.swing.*;
import java.awt.*;

public class HtmlEditorPanel {

    public JPanel mPanel;
    HTMLEditorPane editor;

    //获取内容：tinyMCE.activeEditor.getContent()
    //设置内容：tinyMCE.activeEditor.setContent(“需要设置的编辑器内容”)
    public String getHtml() {
        return editor.getText();
    }

    public void setHtmlText(String html) {
        editor.setText(html);
    }

    public HtmlEditorPanel() {
        editor = new HTMLEditorPane();
        mPanel.add(editor, BorderLayout.CENTER);
        Dimension dimension = new Dimension(600, 250);
        mPanel.setMaximumSize(dimension);
        mPanel.setMaximumSize(dimension);
        mPanel.setPreferredSize(dimension);
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        mPanel = new JPanel();
        mPanel.setLayout(new BorderLayout(0, 0));
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return mPanel;
    }
}
